import config from "@/config"
import http from "@/utils/request"

export default {
  putSeriesData: {
    url: `${config.API_URL}/ms/cms/short/updateCategorySort/`,
    name: "修改series sort",
    put: async function(id, params){
      return await http.put(this.url+id, params, {
        headers: {
          'Content-Type': 'multipart/form-data'
        }
      });
    }
  },
  putSeriesShortData: {
    url: `${config.API_URL}/ms/cms/short/updateShortSort/`,
    name: "修改series short sort",
    put: async function(id, params){
      return await http.put(this.url+id, params, {
        headers: {
          'Content-Type': 'multipart/form-data'
        }
      });
    }
  },
  getSeriesShort: {
    url: `${config.API_URL}/ms/cms/short/list/categoryAndShort`,
    name: "修改series sort",
    get: async function(params){
      return await http.get(this.url, params);
    }
  },
  delCategory: {
    url: `${config.API_URL}/ms/cms/short/delete/category?id=`,
    name: "删除category",
    delete: async function(params){
      return await http.delete(this.url+params);
    }
  },
  delTags: {
    url: `${config.API_URL}/ms/cms/short/delete/tag?tagId=`,
    name: "删除tags",
    delete: async function(params){
      return await http.delete(this.url+params);
    }
  },
  delGenre: {
    url: `${config.API_URL}/ms/cms/short/delete/movieGenre?movieGenreId=`,
    name: "删除genre",
    delete: async function(params){
      return await http.delete(this.url+params);
    }
  },
  delProduction: {
    url: `${config.API_URL}/ms/cms/short/delete/production?productionId=`,
    name: "删除production",
    delete: async function(params){
      return await http.delete(this.url+params);
    }
  },
  postCategory: {
    url: `${config.API_URL}/ms/cms/short/save/category`,
    name: "提交category",
    post: async function(data){
      return await http.post(this.url, data)
    }
  },
  postTags: {
    url: `${config.API_URL}/ms/cms/short/save/tag`,
    name: "提交tag",
    post: async function(data){
      return await http.post(this.url, data)
    }
  },
  postGenre: {
    url: `${config.API_URL}/ms/cms/short/save/movieGenre`,
    name: "提交movieGenre",
    post: async function(data){
      return await http.post(this.url, data)
    }
  },
  postProduction: {
    url: `${config.API_URL}/ms/cms/short/save/production`,
    name: "提交production",
    post: async function(data){
      return await http.post(this.url, data)
    }
  }
}
